<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Wallet extends Model
{
    protected $table = 'wallets';

    protected $fillable = [
        'id',
        'cid', //币种id
        'address', //钱包地址
        'balance', //当前余额
        'block_balance', //锁定余额
        'grand_recharge', //累计充币额
        'grand_withdraw', //累计提币额
        'grand_proc', //累计手续费
        'status', //状态 0 可用 1冻结
        'private_key',
        'wif_key',
        'public_key',
        'ucomp_pub_key',
        'pub_key_x',
        'pub_key_y',
        'uncomp_address',
    ];

    const STATUS_ONE = 0;
    const STATUS_TWO = 1;
    public static $STATUS = [
        self::STATUS_ONE => '可用',
        self::STATUS_TWO => '冻结',
    ];

    //关联币种
    public function currency()
    {
        return $this->hasOne('App\\Models\\Currency', 'id', 'cid');
    }
}
